package com.xcdh.orm.client;

import com.xcdh.domain.RequestPage;
import com.xcdh.domain.vo.PageVO;
import com.xcdh.domain.vo.R;
import com.xcdh.orm.ddl.DDLTable;
import com.xcdh.orm.entity.OrmDataSource;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


import java.util.List;

@FeignClient("xcdh-orm")
public interface DsClient {

    @GetMapping("/dsConfig/listByPage")
    public R<PageVO<OrmDataSource>> findDataSources(@RequestBody RequestPage<OrmDataSource> page);

    @GetMapping("/dsConfig/list")
    public R<List<OrmDataSource>> findListDataSources(@RequestBody OrmDataSource dataSource);

    @PostMapping("/queryTable/{serviceId}")
    public R queryTable(@PathVariable String serviceId , @RequestBody DDLTable table) ;

    @PostMapping("/ddl/showDataBases/{serviceId}")
    public R showDataBases(@PathVariable String serviceId) ;
}
